<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/flv.js/1.6.2/flv.js"></script>

    <script src="http://cdn.jsdelivr.net/npm/xgplayer/browser/index.js" charset="utf-8"></script>
<script src="http://cdn.jsdelivr.net/npm/xgplayer-flv.js/browser/index.js" charset="utf-8"></script>
</head>
<body>
    
    <video class="video-content" id="videoElement">
        您的浏览器不支持 HTML5 video！
    </video>
    <div id="player"></div>
    
<script type="text/javascript">
    new window.FlvJsPlayer({
        id: 'player',
        isLive: false,
        playsinline: true,
        url: 'http://localhost/big_buck_bunny.flv',
        autoplay: true,
        height: window.innerHeight,
        width: window.innerWidth
    });
        // if (flvjs.isSupported()) {
    //     var videoElement = document.getElementById('videoElement');
    //     var flvPlayer = flvjs.createPlayer({
    //         type: 'flv',
    //         url: 'http://localhost/big_buck_bunny.flv'
    //     },{//Config
    //         enableWorker: false, 
    //         enableStashBuffer: false
    //         //当带音频播放时,config部分配置项尽量采取默认状态,否则过分优化会造成卡死
    //     });
    //     flvPlayer.attachMediaElement(videoElement);
    //     flvPlayer.load();
    //     flvPlayer.play();
    // }
</script>

</body>
</html>